#include<bits/stdc++.h>
using namespace std;

class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int low = 0, high = nums.size();
        int mid;
        while(low < high){
            mid = (low + high) / 2;
            if(nums[mid] == mid)low = mid + 1;
            else high = mid;
        }
        return high;
    }
};

/**
 * 2021.10.8
 * 排序数组中的搜索问题，首先想到二分去做
 */